{include file="index/head" /}
<div class="box">
  <form method="post" action="{:url('dels')}" id="listform" data-type=ajax>
    <input type="hidden" name="nid" value="{$nid}" />
    <div class="box-head">
      <ul class="search">
        <li><a href="{:url('add',['nid'=>$nid])}" class="btn"><i class="icon-plus-square-o"></i>添加内容</a></li>
        <li><span>搜索：</span></li>
        <li><span>状态</span>
          <select name="s_status" onchange="sycms.search('{:url('index')}')">
            <option value="">状态</option>
            <option value="1">开启</option>
            <option value="0">关闭</option>
          </select>
        </li>       
        <li>
        <span>关健字</span>
        <input type="text" class="intxt" name="title" placeholder="请输入搜索关健字" />
        </li>
        <li>
        <button type="button" class="btn" onclick="sycms.search('{:url('index')}')"><i class="icon-search"></i> 搜索</button>
        </li>
      </ul>
      <a href="javascript:history.go(0);" class="btn fr"><i class="icon-refresh"></i> 刷新</a> </div>
    <table class="table">
      <tr>
        <th width="100">ID</th>
        <th>优惠券标题</th>
        <th>优惠券类型</th>
        <th>优惠券金额</th>
								<th>优惠券数量</th>
								<th>优惠券有效期(天)</th>
								<th>优惠券状态</th>
        <th width="10%">创建日间</th>
        <th width="250">操作</th>
      </tr>
      {volist name="list" id="v"}
      <tr>
        <td class="td1"><input type="checkbox" name="id[]" value="{$v.id}" />{$v.id}</td>
        <td>{$v.title}</td>      
							 <td>{$v.type}</td>
								<td>{$v.price}</td>
								<td>{$v.num}</td>
								<td>{$v.day}天</td>
        <td>{if condition="$v.status eq 0"}关闭{else/}<font color="#00CC99">开启</font>{/if}</td>
        <td>{$v.datetime}</td>
        <td>
									{if condition="$v.status eq 1 && $v.num gt 0"}<a href="{:url('fafang',['id'=>$v.id])}" class="btn"><i class="icon-bullhorn"></i> 发放</a>{/if}
									<a href="{:url('add',['id'=>$v.id])}" class="btn"><i class="icon-edit"></i> 编辑</a> 
									<a href="javascript:void(0);" onclick="sycms.del('{:url('del',['id'=>$v.id])}')" class="btn red"><i class="icon-trash-o"></i> 删除</a>
							 </td>
      </tr>
      {/volist}
      {if $list[0]}
      <tr>
        <td colspan="9"><ul class="operat">
            <li class="li1">
              <input type="checkbox" onclick="sycms.allselect(this)" />
              全选</li>
            <li><a href="javascript:void(0);" onclick="sycms.delallSelect('{:url('delAll')}')" class="btn red"><i class="icon-trash-o"></i> 批量删除</a></li>
            <li><span>操作：</span>
              <select name="status" onchange="sycms.plattr('{:url('upStatus')}',this)">
                <option value="">状态</option>
                <option value="1">开启</option>
                <option value="0">关闭</option>
              </select>             
            </li>            
          </ul></td>
      </tr>
      <tr>
        <td colspan="9"><div class="page">{$page}</div></td>
      </tr>
      {/if}
    </table>
  </form>
</div>
